package cn.keduox.entity;

import cn.keduox.annotation.*;

import javax.xml.soap.Name;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 书籍一级类型的子类型
 */
@Table(name = "sub_type")
public class SubType implements Serializable{
    /**
     * id
     */
    @Id(name = "id")
    @Column(name = "id")
    private String id;
    /**
     * 名称
     */
    @Column(name = "name")
    private String name;
    /**
     * 所属父类型id
     */
    @Column(name = "first_type_id")
    @Key(farther = "sub_type")
    private String firstTypeId;
    /**
     * 所属父类型
     */
    private FirstType firstType;
    /**
     * 包含的子类型
     */
    @Entity(table = "second_type",field = "id",address = "cn.keduox.entity.SecondType",name = "secondTypeList")
    List<SecondType> secondTypeList=new ArrayList<>();

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    /**
     *删除标记，0正常，1删除

     */
    @Column(name = "del_flag")
    private Integer deleteFlag;

    public SubType(String id, String name, String firstTypeId) {
        this.id = id;
        this.name = name;
        this.firstTypeId = firstTypeId;
    }

    public SubType() {
    }

    public SubType(String id, String name, String firstTypeId, FirstType firstType, List<SecondType> secondTypeList) {
        this.id = id;
        this.name = name;
        this.firstTypeId = firstTypeId;
        this.firstType = firstType;
        this.secondTypeList = secondTypeList;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFirstTypeId() {
        return firstTypeId;
    }

    public void setFirstTypeId(String firstTypeId) {
        this.firstTypeId = firstTypeId;
    }

    public FirstType getFirstType() {
        return firstType;
    }

    public void setFirstType(FirstType firstType) {
        this.firstType = firstType;
    }

    public List<SecondType> getSecondTypeList() {
        return secondTypeList;
    }

    public void setSecondTypeList(List<SecondType> secondTypeList) {
        this.secondTypeList = secondTypeList;
    }
}
